package com.chj.chuji.tijie02;

public class FibonacciTet {
	public static int Fibonacci(int n) {
		if (n <= 1)
			return n;
		int res = 0;
		int n1 = 0, n2 = 1;
		for (int i = 2; i <= n; ++i) {
			res = n1 + n2;
			n1 = n2;
			n2 = res;
			System.out.print(res + "\t");
			if ((i + 2) % 5 == 0)
				System.out.println();
		}
		return res;

	}

	public static void main(String[] args) {
		System.out.println(Fibonacci(20));
	}
}
